<template>
    <p>
        <span v-for="(item,index) in (newArray.length ? newArray:Completed)" :key="index"> {{index + 1}}. {{ item }}</span>
    </p>
   
  </template>
  
  <script>
    import Bus from '@/utils/EventBus';
  export default {
   created () {
     Bus.$on('sendMsg', (msg) => {
     console.log(msg)
     this.num = msg
     this.Completed.splice(this.num.index,1,this.num.text?(this.num.num1 + this.num.num2 === this.num.text ? '回答正确':'回答错误'): '未完成' )
     console.log(this.Completed)
  })
},
data(){
  return{
    num:{
    },
    newArray:[],
    Completed:['未完成','未完成','未完成','未完成','未完成']
  }
}

  };
  </script>
  
  <style scoped>
  .right {
    color: green;
  }
  .error {
    color: red;
  }
  .undo {
    color: #ccc;
  }
  </style>